package 构造器;

/**
 * @author: 谢君臣
 * @Date: 2021/11/16-18:31
 * @version: 1.0
 * @function:
 */
public class A {
    private int num;

    public A() {
    }

    public A(int num) {
        this.num = num;
    }
}

class B extends A {
    public B() {
        //super(1);   //调用父类的构造器
        this(1);  // 调用自己的重写的构造器
    }

    public B(int num) {
        super(num);
    }

    public void add(){}
    public int add(int a){ return 1;}
    public void add(int a,int b){}

}